package com.example.demo.log;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 *
 * Springboot @Validated和@Valid的区别 及使用
 * https://blog.csdn.net/herojuice/article/details/86020101
 *
 * @author fanhb on 2020/7/28
 * @desc xxxx
 */
public class User {

    @NotBlank(message = "不能为空")
    private String name;

    private String userId;
    @Min(value = 18,message = "不能小于18岁")
    @Max(value = 55,message = "不能大于55岁")
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }
}
